From a057c038893b7a9c84524796662de17a97e4437a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Sun, 19 Jul 2009 22:35:25 +0200 Subject: [PATCH] Optimize remove_child_area for children outside region If a child is totally outside the current region, bail early instead of doing costly calculations to subtract the child region. --- gdk/gdkwindow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index eeb89325b3..a1fa4505df 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -636,6 +636,10 @@ remove_child_area (GdkWindowObject *private, r.width = child->width; r.height = child->height; + /* Bail early if child totally outside region */ + if (gdk_region_rect_in (region, &r) == GDK_OVERLAP_RECTANGLE_OUT) + continue; + child_region = gdk_region_rectangle (&r); if (child->shape) -- 2.30.2